﻿// Copyright © Armen Kirakosyan
// armen@kirakosyan.com

namespace Validator
{
    using System;
    using System.Globalization;

    public class ValidationError
    {
        /// <summary>
        /// Line of DOM where error was found
        /// </summary>
        public string Line;
        /// <summary>
        /// Column of DOM where error was found
        /// </summary>
        public string Col;

        /// <summary>
        /// Error description
        /// </summary>
        public string Message;
        public string MessageId;
        public string Explanation;

        /// <summary>
        /// Source block where error was found
        /// </summary>
        public string Source;

        /// <summary>
        /// User friendly error description
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return String.Format(CultureInfo.InvariantCulture,
@"Line {0}, Column {1}: {2}
{3}",
                Line, // 0
                Col,  // 1
                Message, // 2
                Source // 3
            );
        }
    }
}
